import openpyxl



def getsheetwbdata(filename, index):
    rb = xlrd.open_workbook(filename)
    wb = copy(rb)
    ws = wb.get_sheet(index)
    return ws,wb

def writesheetdata(ws, row, col, data):
    ws.cell(row, col).value = data


def savesheetwb(filename, wb):
    wb.save(filename)


def setxlsxboot(filename):
    wb = openpyxl.load_workbook(filename)
    return wb



def getsheet(wb):
    names = wb.sheetnames
    return names



def getsheetdata(wb, sheetname):
    ws = wb[sheetname]
    return ws



def finddata_accurate(data, colarr, conditions):
    meets = []
    for n in colarr:
        if data[n] in conditions:
            meets.append(n)
    return meets